<?php 
namespace Home\Model;
use Think\Model;
class UserModel extends Model {
	
	public function checkEmail($email)
	{	//array('email'=>$email)
		$res = $this->where("email='{$email}'")->find();
		/*$sql = "selcet * from user where email='{$email}'";*/

		return $res;
	}

	public function checkNickname($nickname)
	{	
		$res = $this->where("nickname='{$nickname}'")->find();
		
		return $res;
	}

					//异步传过来的用户数据
	public function checkLogin($email,$password)
	{	//var_dump($email,$password);

		$password=md5($password);

		$sql = "select * from user where email='{$email}' and password='{$password}'";
		$res = $this->query($sql);
		return $res;
		

		// $password = md5($password);
		
		// $sql ="select * from user where email='{$email}' and password= '{$password}'";

		// $this->query($sql);

		/*$data = array(
			'email'=>$email,
			'password'=>md5($password)
			);
		return $this->where($data)->find();*/
	}




}



 ?>